package com.itheima.mapper;

import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MemberMapper {

    // 获取工坊成员集合
    @Select("select * from tb_member")
    public List<Member> getList();

    //根据id查询工坊成员信息
    @Select("select * from tb_member where id=#{id}")
    Member getById(int id);

    // 分页查询工坊成员信息
    @Select("select * from tb_member")
    List<Member> getPage();

    // 根据id修改工坊成员信息
    void update(Member member);

    // 根据id删除工坊成员
    @Delete("delete from tb_member where id=#{id}")
    void delete(int id);

    // 添加工坊成员
    @Insert("insert into tb_member(id,name,gender,dept_id,job_id,updateTime,createTime,academy,major,birthday) values (#{id},#{name},#{gender},#{deptId},#{jobId},#{updateTime},#{createTime},#{academy},#{major},#{birthday})")
    void add(Member member);
}
